package impl

import (
	"gitee.com/hexug/vblog/tree/master/api/apps"
	"gitee.com/hexug/vblog/tree/master/api/apps/post"
	"gitee.com/hexug/vblog/tree/master/api/apps/tag"
	"gitee.com/hexug/vblog/tree/master/api/conf"
	"gorm.io/gorm"
)

type impl struct {
	Db  *gorm.DB
	Tag tag.Server
}

func (i *impl) Name() string {
	return post.AppName
}
func (i *impl) Init() error {
	i.Db = conf.C().Mysql.ORM().Debug()
	i.Tag = apps.GetApp(tag.AppName).(tag.Server)
	return nil
}
func init() {
	apps.RegisterApp(&impl{})
}
